package behaviorType.observer;

public class Main {

    public static void main(String[] args) {
        ISubject iSubject = new AutoSubjectImpl();
        iSubject.setMessage("奥迪A8上市了！！！");

        IObserver fanObserver = new FansObserverImpl();
        IObserver officerObserver = new OfficerObserverImpl();

        iSubject.addObserver(fanObserver);
        iSubject.addObserver(officerObserver);

        iSubject.notifyObservers();

        iSubject.removeObserver(officerObserver);
        
        iSubject.notifyObservers();
    }
}
